//
//  ViewController.m
//  ITUIHelper
//
//  Created by txj on 2017/3/16.
//  Copyright © 2017年 hs. All rights reserved.
//

#import "ViewController.h"
#import "XHDatePickerView.h"
#import "TDatePickerView.h"
#import "TAddressPickerView.h"
#import "TAddressPickerView.h"
#import <ITCategory/NSDate+Extension.h>
#import <ITCategory/UIView+Extension.h>



@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)btn1Tapped:(id)sender {
    XHDatePickerView *datepicker = [[XHDatePickerView alloc] initWithCompleteBlock:^(NSDate *startDate,NSDate *endDate) {
        NSLog(@"\n开始时间： %@，结束时间：%@",startDate,endDate);
        //        self.startTimeText.text = [startDate stringWithFormat:@"yyyy-MM-dd HH:mm"];
        //        self.endtimeText.text = [endDate stringWithFormat:@"yyyy-MM-dd HH:mm"];
    }];
    datepicker.datePickerStyle = DateStyleShowHourMinute;
    datepicker.dateType = DateTypeStartDate;
    datepicker.minLimitDate = [NSDate date:@"2017-2-28 12:22" WithFormat:@"yyyy-MM-dd HH:mm"];
    datepicker.maxLimitDate = [NSDate date:@"2018-2-28 12:12" WithFormat:@"yyyy-MM-dd HH:mm"];
    [datepicker show];
}
- (IBAction)btn3Tapped:(id)sender {
    TDatePickerView *datepicker = [[TDatePickerView alloc] initWithCompleteBlock:^(NSDate *selectDate) {
        NSLog(@"\n选择的时间： %@",selectDate);
        //        self.startTimeText.text = [startDate stringWithFormat:@"yyyy-MM-dd HH:mm"];
        //        self.endtimeText.text = [endDate stringWithFormat:@"yyyy-MM-dd HH:mm"];
    }];
    datepicker.datePickerStyle = TDateStyleShowMonthDayHourMinute;
    datepicker.dateType = TDateTypeStartDate;
    datepicker.labelPosition=8;
    datepicker.minLimitDate = [NSDate date:@"2017-2-28 12:22" WithFormat:@"yyyy-MM-dd HH:mm"];
    datepicker.maxLimitDate = [NSDate date:@"2018-2-28 12:12" WithFormat:@"yyyy-MM-dd HH:mm"];
    [datepicker show];

}

- (IBAction)btn2Tapped:(id)sender {
    
//    在App启动的时候加入以下代码
//    dispatch_queue_t queue = dispatch_queue_create("并行队列", DISPATCH_QUEUE_CONCURRENT);
//    dispatch_async( queue, ^{
//        //耗时操作
//        [CitysHelper getDatabasePath: @"areas.sqlite"];
//    });

    TAddressPickerView *datepicker = [[TAddressPickerView alloc] initWithCompleteBlock:^(NSString *provinceCode, NSString *cityCode, NSString *countyCode, NSString *province, NSString *city, NSString *county) {
        NSLog(@"%@+%@+%@",province,city,county);
    }];
    datepicker.addressPickerStyle=TAddressStyleShowProvenceCityDistrict;
    [datepicker show];
    
    
    

}
@end
